home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Processes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.1 KB  |  191 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Friday, September 13, 1991 at 1:13 PM
  5.  Processes.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1989-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __PROCESSES__
  16. #define __PROCESSES__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __EVENTS__
  23. #include <Events.h>
  24. #endif
  25.  
  26. #ifndef __FILES__
  27. #include <Files.h>
  28. #endif
  29.  
  30.  
  31. /* type for unique process identifier */
  32. struct ProcessSerialNumber {
  33.  unsigned long highLongOfPSN;
  34.  unsigned long lowLongOfPSN;
  35. };
  36.  
  37. typedef struct ProcessSerialNumber ProcessSerialNumber;
  38. typedef ProcessSerialNumber *ProcessSerialNumberPtr;
  39.  
  40.  
  41. enum {
  42.  
  43.  
  44. /*************************************************************************
  45.  *                            Process identifier.
  46.  ************************************************************************
  47.  Various reserved process serial numbers. */
  48.  
  49.  kNoProcess = 0,
  50.  kSystemProcess = 1,
  51.  kCurrentProcess = 2
  52. };
  53.  
  54. /**********************************************************************************************************************************************
  55.  *        Definition of the parameter block passed to _Launch.
  56.  *************************************************************************
  57.  
  58. * Typedef and flags for launchControlFlags field */
  59. typedef unsigned short LaunchFlags;
  60.  
  61. enum {
  62.  
  63.  
  64. /*************************************************************************
  65.  *        Definition of the parameter block passed to _Launch.
  66.  *************************************************************************/
  67.  
  68.  launchContinue = 0x4000,
  69.  launchNoFileFlags = 0x0800,
  70.  launchUseMinimum = 0x0400,
  71.  launchDontSwitch = 0x0200,
  72.  launchAllow24Bit = 0x0100,
  73.  launchInhibitDaemon = 0x0080
  74. };
  75.  
  76. /* Format for first AppleEvent to pass to new process.  The size of the overall
  77.  * buffer variable: the message body immediately follows the messageLength.
  78.  */
  79. struct AppParameters {
  80.  EventRecord theMsgEvent;
  81.  unsigned long eventRefCon;
  82.  unsigned long messageLength;
  83. };
  84.  
  85. typedef struct AppParameters AppParameters;
  86. typedef AppParameters *AppParametersPtr;
  87.  
  88. /* Parameter block to _Launch */
  89. struct LaunchParamBlockRec {
  90.  unsigned long reserved1;
  91.  unsigned short reserved2;
  92.  unsigned short launchBlockID;
  93.  unsigned long launchEPBLength;
  94.  unsigned short launchFileFlags;
  95.  LaunchFlags launchControlFlags;
  96.  FSSpecPtr launchAppSpec;
  97.  ProcessSerialNumber launchProcessSN;
  98.  unsigned long launchPreferredSize;
  99.  unsigned long launchMinimumSize;
  100.  unsigned long launchAvailableSize;
  101.  AppParametersPtr launchAppParameters;
  102. };
  103.  
  104. typedef struct LaunchParamBlockRec LaunchParamBlockRec;
  105. typedef LaunchParamBlockRec *LaunchPBPtr;
  106.  
  107.  
  108. enum {
  109.  
  110.  
  111. /* Set launchBlockID to extendedBlock to specify that extensions exist.
  112. * Set launchEPBLength to extendedBlockLen for compatibility.*/
  113.  
  114.  
  115.  
  116.  
  117.  
  118. #define extendedBlock ((unsigned short)'LC')
  119. #define extendedBlockLen (sizeof(LaunchParamBlockRec) - 12)
  120.  
  121. /*************************************************************************
  122.  * Definition of the information block returned by GetProcessInformation
  123.  ************************************************************************
  124.  Bits in the processMode field */
  125.  
  126.  
  127.  modeDeskAccessory = 0x00020000,
  128.  modeMultiLaunch = 0x00010000,
  129.  modeNeedSuspendResume = 0x00004000,
  130.  modeCanBackground = 0x00001000,
  131.  modeDoesActivateOnFGSwitch = 0x00000800,
  132.  modeOnlyBackground = 0x00000400,
  133.  modeGetFrontClicks = 0x00000200,
  134.  modeGetAppDiedMsg = 0x00000100,
  135.  mode32BitCompatible = 0x00000080,
  136.  modeHighLevelEventAware = 0x00000040,
  137.  modeLocalAndRemoteHLEvents = 0x00000020,
  138.  modeStationeryAware = 0x00000010,
  139.  modeUseTextEditServices = 0x00000008
  140. };
  141.  
  142. /* Record returned by GetProcessInformation */
  143. struct ProcessInfoRec {
  144.  unsigned long processInfoLength;
  145.  StringPtr processName;
  146.  ProcessSerialNumber processNumber;
  147.  unsigned long processType;
  148.  OSType processSignature;
  149.  unsigned long processMode;
  150.  Ptr processLocation;
  151.  unsigned long processSize;
  152.  unsigned long processFreeMem;
  153.  ProcessSerialNumber processLauncher;
  154.  unsigned long processLaunchDate;
  155.  unsigned long processActiveTime;
  156.  FSSpecPtr processAppSpec;
  157. };
  158.  
  159. typedef struct ProcessInfoRec ProcessInfoRec;
  160. typedef ProcessInfoRec *ProcessInfoRecPtr;
  161.  
  162.  
  163. #ifdef __cplusplus
  164. extern "C" {
  165. #endif
  166. #pragma parameter __D0 LaunchApplication(__A0)
  167. pascal OSErr LaunchApplication(const LaunchParamBlockRec *LaunchParams)
  168.  = 0xA9F2; 
  169. pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec,ConstStr255Param pDAName)
  170.  = {0x3F3C,0x0036,0xA88F}; 
  171. pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  172.  = {0x3F3C,0x0037,0xA88F}; 
  173. pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  174.  = {0x70FF,0x2F00,0x3F3C,0x0039,0xA88F}; 
  175. pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  176.  = {0x3F3C,0x0038,0xA88F}; 
  177. pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN,ProcessInfoRecPtr info)
  178.  = {0x3F3C,0x003A,0xA88F}; 
  179. pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  180.  = {0x3F3C,0x003B,0xA88F}; 
  181. pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  182.  = {0x3F3C,0x003C,0xA88F}; 
  183. pascal OSErr SameProcess(const ProcessSerialNumber *PSN1,const ProcessSerialNumber *PSN2,
  184.  Boolean *result)
  185.  = {0x3F3C,0x003D,0xA88F}; 
  186. #ifdef __cplusplus
  187. }
  188. #endif
  189.  
  190. #endif
  191.